@import (reference) 'config';
@import (reference) 'icons';

w-qr-code-read {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  .btn::before {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-image: @qr-code-big-icon;
    background-size: 100% 100%;
    cursor: pointer;
  }
}

.camera-popup {
  display: none;
  position: relative;
  z-index: 100;

  &__video-wrapper {
    position: absolute;
    overflow: hidden;
    min-width: 213px;
    min-height: 160px;
    border-radius: @border-radius / 2;

    & > video {
      background-color: @color-black;
      position: absolute;
      left: 50%;
      top: 50%;
    }

    &.pending, &.error {
      background-color: @color-white;
      border: 1px solid @color-basic-200;
      border-radius: @border-radius;
    }

    &.pending video {
      background-color: transparent;
    }

    &.error::after {
      content: '';
      display: block;
      min-width: 213px;
      min-height: 160px;
      background: url(/img/icons/webcamerror.svg) no-repeat center;
    }

    & > w-button.transparent {
      display: none;
      position: absolute;
      bottom: 0;
      margin: 0 20px 20px;
      width: calc(100% ~'- 40px');
      font-size: 13px;
      z-index: 100;
    }
  }

  &__target-square {
    width: 170px;
    height: 170px;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2500px rgba(0, 0, 0, 0.3)
  }

  &.active {
    display: block;
  }
}

@media screen and (max-width: 540px) {

  .camera-popup {
    &__video-wrapper {
      position: fixed;
      max-width: 100%;
      max-height: 100%;
      top: 0 !important;
      left: 0 !important;
      width: 100% !important;
      height: 100vh !important;
      background-color: @color-black;

      & > w-button.transparent {
        display: block;
      }
    }
  }

}
